{include file="public/header" /}
<span class="layui-breadcrumb">
  <a href="{:url('Blog/index')}?nav=blog-bloglist">产品</a>
  <?php if(strpos($_SERVER["REQUEST_URI"],'y=zh') !== false){ ?>
  <a><cite>编辑中文-{$one['Product_Number']}</cite></a>
  <?php }else{ ?>
  <a><cite>编辑英文-{$one['Product_Number']}</cite></a>
  <?php } ?>
</span>
<style> 
.layui-form-label{width:200px;}
.layui-form-item .layui-input-block{margin-left:230px;}
</style>
<div class="layui-fluid">
    <div class="layui-card">
    	<form class="layui-form" id="product_form" action="" style='padding:10px'>
        <div class="layui-form-item">
              <label class="layui-form-label">内容</label>
              <div class="layui-input-block">
                <?php if(strpos($_SERVER["REQUEST_URI"],'y=zh') !== false){ ?>
                <textarea id="txt" name="txt" style="width:100%;height:300px;">{$one['zh_txt']}</textarea>
                <?php }else{ ?>
                <textarea id="txt" name="txt" style="width:100%;height:300px;">{$one['txt']}</textarea>
                <?php } ?>
              </div>
          </div>
        
        <div class="layui-form-item">
          <label class="layui-form-label"></label>
          <div class="layui-input-block">
             <button type='button' class="layui-btn layui-btn-normal" onclick="tijiao({$one['id']})">确定</button>
          </div>
        </div>

		</form>
    </div>
</div>
{include file="/public/footer" /}
<script charset="utf-8" src="/static/kindeditor/kindeditor-all.js"></script>
<script charset="utf-8" src="/static/kindeditor/lang/zh-CN.js"></script>
<script>
 KindEditor.ready(function(K) {
    window.editor=K.create('#txt',{'items':['source', '|', 'undo', 'redo', '|','selectall', 'preview', 'print', 'code', 'cut', 'copy', 'paste','plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright','justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript','superscript', 'clearhtml', 'quickformat', '|','formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold','italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image', 'media', 'insertfile', 'table', 'hr', 'emoticons', 'baidumap', 'pagebreak','anchor', 'link', 'unlink','|', 'fullscreen'],'uploadJson':"{:url('Base/kindeditor_upload')}",afterCreate : function() { this.sync(); },afterBlur: function(){this.sync();}
    });

  })
 function tijiao(id){
    layer.load();
    var txt=$.trim($("textarea[name='txt']").val());
    <?php if(strpos($_SERVER["REQUEST_URI"],'y=zh') !== false){ ?>
    var y='zh'; 
    <?php }else{ ?>
    var y='en'; 
    <?php } ?>
    $.post("{:url('Product/des')}",{id:id,txt:txt,y},function(res){
      if(res.status=='0'){
        layer.closeAll('loading');
        layer.msg(res.msg);
      }
      if(res.status=='1'){
        layer.msg(res.msg,{time: 500 },
        function(){
          layer.closeAll();
          location.href=location.href;
        });
      }
    })
 }
</script>
